# --------------------------------
# -*- coding: utf-8 -*-
# Author: Zhu
# Date: 2021/12/20   
# Description:作业端-基础资料-商品管理-【商品资料】页面操作方法
# --------------------------------
from PageLocators.page_goodsdata_loc import ele_GOODSMANAGEMENT as loc
from Common.Base import Base
from Common.GetLog import GetLog
log = GetLog.get_logger()
import time

class fun_GOODSDATA(Base):
    u'作业端-基础资料-商品管理-【商品资料】页面操作方法'

    def m_Goods_Data(self):
        '''
        点击商品资料，打开商品资料页面
        :return:
        '''
        log.info('点击商品资料，打开商品资料页面')
        print('点击商品资料，打开商品资料页面')
        self.base_click(loc.ys_GoodsInfo)
        time.sleep(1)

    def m_Goods_Create(self):
        '''
        点击创建按钮，打开创建商品资料页面
        :return:
        '''
        log.info('点击创建按钮，打开创建商品资料页面')
        print('点击创建按钮，打开创建商品资料页面')
        self.base_click(loc.ys_Goods_Create)
        time.sleep(1)

    def m_Goods_Input(self,Goods_BM , Goods_WBBM , Goods_TM , Goods_Name , Goods_Model,
                      Length ,Width , Heigth , NedWeight , GrossWeight , Buy , Sell , Brand , Origin):
        '''
        填写商品资料信息--输入框
        :return:
        '''
        log.info('输入商品资料信息--商品编码')
        print('输入商品资料信息--商品编码')
        self.base_input(loc.ys_Goods_BM,Goods_BM)
        time.sleep(1)

        log.info('输入商品资料信息--外部商品编码')
        print('输入商品资料信息--外部商品编码')
        self.base_input(loc.ys_Goods_WBBM,Goods_WBBM)
        time.sleep(1)

        log.info('输入商品资料信息--商品条码')
        print('输入商品资料信息--商品条码')
        self.base_input(loc.ys_Goods_TM,Goods_TM)
        time.sleep(1)

        log.info('输入商品资料信息--商品名称')
        print('输入商品资料信息--商品名称')
        self.base_input(loc.ys_Goods_Name,Goods_Name)
        time.sleep(1)

        log.info('输入商品资料信息--规格型号')
        print('输入商品资料信息--规格型号')
        self.base_input(loc.ys_Goods_Model,Goods_Model)
        time.sleep(1)

        log.info('输入商品资料信息--长宽高')
        print('输入商品资料信息--长宽高')
        self.base_input(loc.ys_Goods_Length,Length)
        time.sleep(1)
        self.base_input(loc.ys_Goods_Width,Width)
        time.sleep(1)
        self.base_input(loc.ys_Goods_Heigth,Heigth)
        time.sleep(1)

        log.info('输入商品资料信息--净重、毛重')
        print('输入商品资料信息--净重、毛重')
        self.base_input(loc.ys_Goods_NedWeight,NedWeight)
        time.sleep(1)
        self.base_input(loc.ys_Goods_GrossWeight,GrossWeight)
        time.sleep(1)

        log.info('输入商品资料信息--进价、售价')
        print('输入商品资料信息--进价、售价')
        self.base_input(loc.ys_Goods_Buy,Buy)
        time.sleep(1)
        self.base_input(loc.ys_Goods_Sell,Sell)
        time.sleep(1)

        log.info('输入商品资料信息--品牌、产地')
        print('输入商品资料信息--品牌、产地')
        self.base_input(loc.ys_Goods_Brand,Brand)
        time.sleep(1)
        self.base_input(loc.ys_Goods_Origin,Origin)
        time.sleep(1)


    def m_Goods_ChooseList(self):
        '''
        填写商品资料信息--下拉列表
        :return:
        '''
        log.info('点击货主名称，选择货主')
        print('点击货主名称，选择货主')
        self.base_click(loc.ys_Goods_Shipper)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Shipper2)
        time.sleep(1)

        log.info('点击商品分类，选择分类')
        print('点击商品分类，选择分类')
        self.base_click(loc.ys_Goods_Sort)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Sort2)
        time.sleep(1)

        log.info('点击计量单位，选择-支')
        print('点击计量单位，选择-支')
        self.base_click(loc.ys_Goods_Unit)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Unit2)
        time.sleep(1)

        log.info('点击商品类型，选择正常商品')
        print('点击商品类型，选择正常商品')
        self.base_click(loc.ys_Goods_Type)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Type2)
        time.sleep(1)

        log.info('点击商品件型，选择小件')
        print('点击商品件型，选择小件')
        self.base_click(loc.ys_Goods_Part)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Part2)
        time.sleep(1)

        log.info('点击供应商，选择供应商')
        print('点击供应商，选择供应商')
        self.base_click(loc.ys_Goods_Supplie)
        time.sleep(1)
        self.base_click(loc.ys_Goods_Supplie2)
        time.sleep(1)

    def m_Goods_SubmitBtn(self):
        '''
        点击确定按钮，创建商品资料
        :return:
        '''
        log.info('点击确定按钮，创建商品资料')
        print('点击确定按钮，创建商品资料')
        self.base_click(loc.ys_Goods_SubmitBtn)
        time.sleep(1)

